package com.tran.app.dao

import androidx.room.*
import com.tran.app.data.UserInfo

@Dao
interface UserInfoDao {
    @Insert
    fun insertUser(user: UserInfo)

    @Query("SELECT * FROM UserInfo WHERE id = :id")
    fun getUserById(id: Int): UserInfo?

    @Query("SELECT * FROM UserInfo WHERE name = :name")
    fun getUserByName(name: String): UserInfo?

    @Update
    fun update(user: UserInfo)
}